package com.ruoyi.hov.controller;


import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.hov.entity.ClassBindHov;
import com.ruoyi.hov.service.ClassBindHovService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 属性绑定hov 前端控制器
 * </p>
 *
 * @author XiaShiLong
 * @since 2021-04-01
 */
@RestController
@RequestMapping("/classBindHov")
@Api("类属性绑定hov")
public class ClassBindHovController extends BaseController {

    private final ClassBindHovService service;

    @Autowired
    public ClassBindHovController(ClassBindHovService service) {
        this.service = service;
    }

    @PreAuthorize("@ss.hasPermi('classBindHov:post:add')")
    @Log(title = "新增", businessType = BusinessType.INSERT)
    @ApiOperation("新增")
    @PostMapping
    public AjaxResult add(@RequestBody List<ClassBindHov> classBindHovList) {
        return toAjax(service.saveAll(classBindHovList));
    }

    @PreAuthorize("@ss.hasPermi('classBindHov:delete:delete')")
    @Log(title = "删除", businessType = BusinessType.DELETE)
    @ApiOperation("删除")
    @DeleteMapping
    public AjaxResult delete(ClassBindHov classBindHov) {
        return toAjax(service.delete(classBindHov));
    }
}
